Litter and Trash Cans
logo

Welcome

In this we will be taking an advanced look at a cleanup that the Rubbish team did.

Project uses R vizualization and Python scripting together

What about Collection Objects?

Collection Objects would be Trash Cans, Recycling Cans, and Tobacco Ash Cans.

explain clustering

The breakdown of Collection Object Clustering

Legend

This shows the breakdown of clusterings, from Collection Object Type, to litter type, then to the day of the week it was collected.

This graph does a great job of breaking down the desparities of Trash Cans and Recycling Cans, while also showing similarities!

Did the Rubbish Team have an effect?

To see if the Rubbish team had an effect on the clustering, we should look where they were focused.

This graph represents the amount of litter collected per hour, for each collection object.

This graph shows two things:

  • This is a multi-day event, which means is why we see the sharp spikes leading to 0 litter being collected for some hours.

  • The litter team had stayed by certain collection objects for longer than others.

Well, how close was the litter to Collection Objects?

To see this, we need compare the mean distances for each collection object. It will be better to view this for each individual day, as we know there was more foot traffic on Tuesday and Wednesday.

This graph shows that ||| PERCENTAGE ||| of the litter has a mean distance of under 20 meters to the closest applicable Collection Object.

What does this all mean?

Well here is a searchable data table to view the clusteringss yourself, along with some basic statistics for each!

What does this look like?

We have looked at all the numbers, lets try and see what this actually means in regards to real life!

colors <- colorNumeric(
  # function for color of collection types
  palette = c('#134a47', '#2859b8', 'green'),
  domain = c(1,2,3)
  )

labs <- lapply(seq(nrow(clusters)), function(i) {
  # function for mouseover of circles
  paste0( 'Collection Type: ', clusters[i, "cent_type"], '<p>Number of Litter Objects: ', 
          clusters[i, "num_litter"], '</p>Mean Distance: ', 
          round(clusters[i, "mean_dist"],2),' meters<p>Max Distance: ', 
          round(clusters[i, "max_dist"],2), ' meters</p>' ) 
})

html_legend <- "<img src='open-trash-can.png' style='width:20px;height:20px;'> Trash & Recycling<br/>

<img src='open-trash-can.png' style='width:20px;height:20px;'> Paper<br/>

<img src='cigarette.png' style='width:20px;height:20px;'> Tobacco<br/>

<img src='open-trash-can.png' style='width:20px;height:20px;'> Unknown<br/>

<img src='open-trash-can.png' style='width:20px;height:20px;'> Plastic<br/>

<img src='open-trash-can.png' style='width:20px;height:20px;'> Food<br/>

<img src='open-trash-can.png' style='width:20px;height:20px;'> Glass"

map <- clusters %>% 
  mutate(
    cent_type = ifelse(cent_type == 'trashCan', 1,
                       ifelse(cent_type == 'recyclingCan', 2, 3))
  ) %>% 
  leaflet(width = "100%") %>% 
  setView(lng = -122.2298, lat = 37.48650, zoom = 18) %>% 
  addProviderTiles(providers$CartoDB.Positron) %>% 
  addCircles(
    ~long, ~lat,
    radius = ~mean_dist,
    color = ~colors(cent_type),
    opacity = ~num_litter/357,
    label = lapply(labs, HTML),
    group = "Collections"
  ) %>% 
  addMarkers(lng = ~long, lat = ~lat,
             icon = makeIcon("open-trash-can.png", "open-trash-can.png", 15,15),
             group = "Collections"
             ) %>% 
  addLayersControl(
    overlayGroups = c("Collections", litter),
    options = layersControlOptions(collapsed = FALSE)
  ) %>% 
  addControl(html = html_legend, position = "bottomleft")



for (i in 1:length(litter)){
  map <- map %>% 
    addMarkers(data = clustered_data %>% 
                 subset(rubbishType == litter[[i]]),
               lng = ~long, lat = ~lat,
               icon = makeIcon(icons[[i]], icons[[i]], 7,7),
               group = litter[[i]]
               ) 
}

map

ffffffffffffffffffffffffffffff

map looks disgusting

hexbin?

clusters based on polygons?

  • python script to get polygons?
 




A work by Alexander Kahanek x Rubbish, co.